import com.wp.dao.UserDao;
import com.wp.dao.UserDaoImpl;
import com.wp.service.UserService;
import com.wp.service.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserBean {
    public static void main(String[] args) {
        // 获取IoC容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        // 得到容器后获取容器中的bean
        UserService userService = (UserService) context.getBean("userService");

        userService.save();
    }
}
